to_csv乱码
self.new_df.to_csv(‘aaaa.csv’, encoding=’utf_8’)之后还是乱码,将utf_8改为utf_8_sig即可
1 | self.new_df.to_csv('aaaa.csv', encoding='utf_8_sig') |
read_csv指定分隔符
1 | self.df = pd.read_csv(FILE_PATH, sep="|,", encoding = "utf-8") |
迭代dataframe
1 | for index, col in self.df.iterrows(): |